package com.cm.domain;

import java.util.Scanner;

public class Sum {
    Scanner input = new Scanner(System.in);
    public int sumPara(int nums[]){
        int max = 0;
        for (int i= 0; i< nums.length; i++){
            int sum = 0;
            for (int j =i;j < nums.length; j++){
                sum = sum +nums[j];
                if(sum >max){
                    max = sum;
                }
            }
        }
            System.out.println("最大值为"+max);
        return max;
    }

}
